package com.srpingde.hhh.http;

import android.content.Context;

public class HHHHttpRequestBase {
	
	AsyncHttpClient client = new AsyncHttpClient();
	
	private Context context;
	private boolean showLoadingProgress;
	//private LoadingBar loadingBar;

	public HHHHttpRequestBase(){
		showLoadingProgress = true;
	}
	
	public HHHHttpRequestBase(Context context){
		showLoadingProgress = true;
		this.context = context;
	}
	
	public Context getContext() {
		return context;
	}

	public void setContext(Context context) {
		this.context = context;
	}

	public boolean isShowLoadingProgress() {
		return showLoadingProgress;
	}

	public void setShowLoadingProgress(boolean showLoadingProgress) {
		this.showLoadingProgress = showLoadingProgress;
	}
	
	/*public void startLoadingProgress(){
		if(showLoadingProgress && context != null){
			ViewGroup rootView = (ViewGroup)((Activity)context).getWindow().getDecorView().findViewById(android.R.id.content);
			if(rootView.getChildAt(rootView.getChildCount()-1) instanceof LoadingBar){
				return;
			}
			loadingBar = new LoadingBar(context);
			loadingBar.getBackground().setAlpha(204);
			rootView.addView(loadingBar,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
			loadingBar.startAnimation();
		}
	}*/
	
	/*public void dismissLoadingprogress(){
		if(showLoadingProgress && context != null && null != loadingBar){
			ViewGroup rootView = (ViewGroup)((Activity)context).getWindow().getDecorView().findViewById(android.R.id.content);
			loadingBar.dismiss();
			rootView.removeView(loadingBar);
		}
	}*/
}
